<?php  

if ( ! defined('BASEPATH')) exit('No direct script access allowed'); 

class MY_Exceptions extends CI_Exceptions {

    function __construct(){
        parent::__construct();
    }
	/*
	public function show_404()
    {
        $CI =& get_instance();
        //$CI->load->view('my_notfound_view');
		$CI->load->view('templates/header', $data);
		$CI->load->view('errors/error_404', $data);
		$CI->load->view('templates/footer', $data);
        //echo $CI->output->get_output();
        //exit;
    }
	*/

    function show_404()
	{ 
		/*
		| This commented lines throw a blank page
		|--------------------------------------------
		// error page logic
       	header("HTTP/1.1 404 Not Found");
		//
        // First, assign the CodeIgniter object to a variable
        $CI =& get_instance();
		//
        // do what you want here, even db stuff or just 
        // load your template with a custom 404
        $data['heading'] = "404 Page Not Found";
        $data['message'] = "The page you requested was not found ";
        $data['main_content'] = 'errors/error_404';
		//
		$data['title'] = 'Error 404 - Not Found';
		$CI->load->view('templates/header', $data);
		$CI->load->view('errors/error_404', $data);
		$CI->load->view('templates/footer', $data);
		*/
		
		/*
		| This works fine
		|--------------------------------------------
		*/
		/**/
		//header("HTTP/1.1 404 Not Found"); // dont't throw error
		$title = "Error 404 - Not Found";
		$data['message'] = "The page you requested was not found ";
		include(APPPATH.'views/templates/header.php');
        include(APPPATH.'views/errors/error_404.php');
		include(APPPATH.'views/templates/footer.php');
		

    }
}
?>